package quartz;

import java.util.Date;
import java.util.TimerTask;

/**
 * 模擬 Task 啟動後所要執行的動作, 動作如同 method run()<br>
 * <br>
 * Copyright: Copyright (c) 2001-2007<br>
 * Company: 一零四資訊科技股份有限公司
 * @author Eric.Kao(eric.kao@104.com.tw)
 * @version 1.0
 */
public class MyTask extends TimerTask
{
    int idx = 0;

    public MyTask()
    {
    }

    /**
     * When an object implementing interface <code>Runnable</code> is used to create a thread, starting the
     * thread causes the object's <code>run</code> method to be called in that separately executing thread.
     */
    public void run()
    {
        idx++;
        System.out.println( new Date() + ", 次數:" + idx );
    }
}
